Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPDA Evaluator: Value, Description and Children should not be fetched on the EDT #5877

Merged
merged 1 commit into from
Jun 10, 2023

Conversation

matthiasblaesing
Copy link
Contributor

While running NetBeans with assertions enabled, while tryping to open the detail/value dialog for the "String value", an AssertionError was observed.

java.lang.AssertionError: Debugger lock taken in AWT Event Queue!
  at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl$DebuggerReentrantReadWriteLock$DebuggerReadLock.lock(JPDADebuggerImpl.java:2710)
  at org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl$ThreadReentrantReadWriteLock$ThreadWriteLock.lock(JPDAThreadImpl.java:2581)
  at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.invokeMethod(JPDADebuggerImpl.java:1080)
  at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.invokeMethod(JPDADebuggerImpl.java:1022)
  at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:500)
  at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:464)
  at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:428)
  at org.netbeans.modules.debugger.jpda.ui.models.VariablesTableModel.getValueAt(VariablesTableModel.java:108)
  at org.netbeans.spi.viewmodel.Models$DelegatingTableModel.getValueAt(Models.java:2249)
  at org.netbeans.modules.debugger.jpda.ui.models.NumericDisplayFilter.getValueAt(NumericDisplayFilter.java:112)
  at org.netbeans.spi.viewmodel.Models$CompoundTableModel.getValueAt(Models.java:1439)
  at org.netbeans.modules.debugger.jpda.ui.models.VariablesTreeModelFilter.getValueAt(VariablesTreeModelFilter.java:530)
  at org.netbeans.spi.viewmodel.Models$CompoundTableModel.getValueAt(Models.java:1439)
  at org.netbeans.modules.debugger.jpda.ui.models.EvaluatorTableModelFilter.getValueAt(EvaluatorTableModelFilter.java:71)
  at org.netbeans.spi.viewmodel.Models$CompoundTableModel.getValueAt(Models.java:1439)
  at org.netbeans.spi.viewmodel.Models$CompoundTableModel.getValueAt(Models.java:1441)
  at org.netbeans.spi.viewmodel.Models$CompoundTableModel.getValueAt(Models.java:1441)
  at org.netbeans.spi.viewmodel.Models$CompoundModel.getValueAt(Models.java:4565)
  at org.netbeans.modules.viewmodel.TreeModelNode$MyProperty.updateShortDescription(TreeModelNode.java:2094)
  at org.netbeans.modules.viewmodel.TreeModelNode$MyProperty.getShortDescription(TreeModelNode.java:2076)
  at org.openide.explorer.propertysheet.CustomEditorAction.actionPerformed(CustomEditorAction.java:290)
  at org.openide.explorer.propertysheet.PropertyPanel$CustomEditorProxyAction.actionPerformed(PropertyPanel.java:1199)
  at org.openide.explorer.view.OutlineView$OutlineViewOutline.editCellAt(OutlineView.java:2115)
  at java.desktop/javax.swing.plaf.basic.BasicTableUI$Handler.adjustSelection(BasicTableUI.java:1147)
  at java.desktop/javax.swing.plaf.basic.BasicTableUI$Handler.mousePressed(BasicTableUI.java:1077)

Indeed here the call comes from the EDT and directly tries to access the JPDA connection.

The fix is inspired from JPDAAsynchronousModel and moves value fetching from the EDT to the JPDA thread.

… on the EDT

While running NetBeans with assertions enabled, while tryping to open
the detail/value dialog for the "String value", an AssertionError was
observed.

java.lang.AssertionError: Debugger lock taken in AWT Event Queue!
  at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl$DebuggerReentrantReadWriteLock$DebuggerReadLock.lock(JPDADebuggerImpl.java:2710)
  at org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl$ThreadReentrantReadWriteLock$ThreadWriteLock.lock(JPDAThreadImpl.java:2581)
  at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.invokeMethod(JPDADebuggerImpl.java:1080)
  at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.invokeMethod(JPDADebuggerImpl.java:1022)
  at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:500)
  at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:464)
  at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:428)
  at org.netbeans.modules.debugger.jpda.ui.models.VariablesTableModel.getValueAt(VariablesTableModel.java:108)
  at org.netbeans.spi.viewmodel.Models$DelegatingTableModel.getValueAt(Models.java:2249)
  at org.netbeans.modules.debugger.jpda.ui.models.NumericDisplayFilter.getValueAt(NumericDisplayFilter.java:112)
  at org.netbeans.spi.viewmodel.Models$CompoundTableModel.getValueAt(Models.java:1439)
  at org.netbeans.modules.debugger.jpda.ui.models.VariablesTreeModelFilter.getValueAt(VariablesTreeModelFilter.java:530)
  at org.netbeans.spi.viewmodel.Models$CompoundTableModel.getValueAt(Models.java:1439)
  at org.netbeans.modules.debugger.jpda.ui.models.EvaluatorTableModelFilter.getValueAt(EvaluatorTableModelFilter.java:71)
  at org.netbeans.spi.viewmodel.Models$CompoundTableModel.getValueAt(Models.java:1439)
  at org.netbeans.spi.viewmodel.Models$CompoundTableModel.getValueAt(Models.java:1441)
  at org.netbeans.spi.viewmodel.Models$CompoundTableModel.getValueAt(Models.java:1441)
  at org.netbeans.spi.viewmodel.Models$CompoundModel.getValueAt(Models.java:4565)
  at org.netbeans.modules.viewmodel.TreeModelNode$MyProperty.updateShortDescription(TreeModelNode.java:2094)
  at org.netbeans.modules.viewmodel.TreeModelNode$MyProperty.getShortDescription(TreeModelNode.java:2076)
  at org.openide.explorer.propertysheet.CustomEditorAction.actionPerformed(CustomEditorAction.java:290)
  at org.openide.explorer.propertysheet.PropertyPanel$CustomEditorProxyAction.actionPerformed(PropertyPanel.java:1199)
  at org.openide.explorer.view.OutlineView$OutlineViewOutline.editCellAt(OutlineView.java:2115)
  at java.desktop/javax.swing.plaf.basic.BasicTableUI$Handler.adjustSelection(BasicTableUI.java:1147)
  at java.desktop/javax.swing.plaf.basic.BasicTableUI$Handler.mousePressed(BasicTableUI.java:1077)

Indeed here the call comes from the EDT and directly tries to access
the JPDA connection.

The fix is inspired from JPDAAsynchronousModel and moves value fetching
from the EDT to the JPDA thread.
@matthiasblaesing matthiasblaesing added the Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) label Apr 24, 2023
@matthiasblaesing matthiasblaesing added this to the NB19 milestone Apr 24, 2023
@matthiasblaesing
Copy link
Contributor Author

I intent to merge this by next weekend if noone intervenes till then.

@matthiasblaesing matthiasblaesing merged commit 75d7235 into apache:master Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant